package com.xjust.controller.inspection;

import com.xjust.service.InspectionResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@RestController

@RequestMapping("/inspectionresults")
public class InspectionResultController {

    @Autowired
    private InspectionResultService inspectionResultService;

    @GetMapping("/getInspectionResult")
    public List<Map<String,Object>> getInspectionResult(String tech_code,
                                                   String tech_name,
                                                   String tech_format,
                                                   BigDecimal tech_price,
                                                   String inspection_state,
                                                   String price_type, Integer inspection_employee_id){
        return inspectionResultService.getInspectionResult(tech_code, tech_name,tech_format,tech_price,inspection_state,price_type,inspection_employee_id);
    }

    @GetMapping("/getInspectionRequest")
    public  List<Map<String,Object>> getInspectionRequest(LocalDateTime creation_time,
                                                     Integer inspection_employee_id,
                                                     String inspection_position,
                                                     String inspection_info,
                                                     String inspection_remark,
                                                     String inspection_result,
                                                     LocalDateTime inspection_time
    ){
        return inspectionResultService.getInspectionRequest(creation_time,inspection_employee_id,inspection_position,inspection_info,inspection_remark,inspection_result,inspection_time);
    }
}
